package com.kc.data.common.exception;

/**
 * TODO
 * 自定义异常
 *
 * @author zhangshuo
 * @version 1.0
 * @date 2020/9/26
 */
public class CustomException extends RuntimeException {
    private static final long serialVersionUID = 1L;

    private Integer code;

    private String msg;

    public CustomException(String msg) {
        this.msg = msg;
    }

    public CustomException(String msg, Integer code) {
        this.msg = msg;
        this.code = code;
    }

    public CustomException(String msg, Throwable e) {
        super(msg, e);
        this.msg = msg;
    }

    @Override
    public String getMessage() {
        return msg;
    }

    public Integer getCode() {
        return code;
    }
}

